While watching a video, users often wish to seek to a particular location in the video. For instance, a user watching a movie stored on a hard disk drive may wish to skip to a designated chapter that corresponds to a certain time in the movie. Alternatively or in addition, the user may wish to fast forward the movie for a certain amount of time. To seek to these desired locations, traditional video players look to an index that correlates movie times with byte offsets.
For instance, imagine that a user wishes to resume watching a movie at a time of 30:44. Furthermore, imagine that the movie has a length of 2 hours and a total size of 2 Gigabytes (GB). The index may therefore advise the video player that the time of 30:44 corresponds to a byte offset of 322,122,547. The video player may accordingly begin reading and playing the movie at this specified byte offset.
While a user may store an entire video on a hard disk drive before watching the video, the user may also choose to begin watching the video while the video downloads. In these instances, the video often resides within a file that includes the index at or near the end of the file. Therefore, when the user wishes to seek within a video while the video downloads, the video player typically does not have access to the index. As such, the video player cannot easily find a byte offset corresponding to a specified seek time.
Two processes to attempt to find such corresponding byte offsets exist. First, a video player may merely read some or all of the data samples already downloaded to determine the data sample that corresponds to the specified seek time. Once the video player finds this data sample, the player may begin reading and playing the video at a byte offset corresponding to this data sample. This process, however, generally proves to be computationally-expensive to a prohibitive degree.
Another process includes calculating an estimated bitrate for an entire video based upon a known video length and a known video size. After calculating this bitrate, the video player multiplies the bitrate by the seek time to roughly estimate the corresponding byte offset. While this method may prove suitable for constant bitrate (CBR) videos, this method generally proves unsuitable for variable bitrate (VBR) videos, as time and byte offset values within VBR videos typically do not correspond on a one-to-one basis.